using System;
using System.ServiceModel;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Microsoft.Services.TfsAlert.TfsAlertScenarioTests
{
    [ServiceContract(
       Namespace = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/02")]
    public interface INotificationReciever
    {
        [OperationContract(
            Action = "http://schemas.microsoft.com/TeamFoundation/2005/06/Services/Notification/02/Notify")]
        void Notify(string eventXml, string tfsIdentityXml);
    }   

    [TestClass]
    public class NotificationReciever_wcf
    {
        [TestMethod]
        public void CanCallNotificationRecieverUsingWCF()
        {
            EndpointAddress endPointAddress = new EndpointAddress("http://localhost:9999/TFSAlert");
            INotificationReciever notifyProxy = new ChannelFactory<INotificationReciever>(new BasicHttpBinding(), endPointAddress).CreateChannel();

            notifyProxy.Notify("Message From CanCallNotificationRecieverUsingWCF UnitTest", "FOOBAR IdentityXML");
        }
    }
}
